<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
</head>

<body>
    <input type="button" value="选择" onclick="choose('0010', '小米')">
    <font>0010</font>&nbsp&nbsp&nbsp
    <font>小米</font>
    <br>
    <hr>

    <input type="button" value="选择" onclick="choose('0012', '小含')">
    <font>0012</font>&nbsp&nbsp&nbsp
    <font>小含</font>
</body>
<script>
    function choose(num, name) {
        //<!--获取父窗口对象-->
        var getOpener = window.opener;
        var choose1 = getOpener.document.getElementById("id1");
        choose1.value = num;
        var choose2 = getOpener.document.getElementById("id2");
        choose2.value = name;
        window.close();
    }
</script>
</body>

</html>